<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/24
 * Time: 14:55
 */

namespace backend\components;


use yii\base\ActionFilter;

class MyFilter extends ActionFilter
{

    public $name;

    public function beforeAction($action)
    {
        echo "before".$this->name;
        return parent::beforeAction($action);
    }


    public function afterAction($action, $result)
    {
        echo "after".json_encode($action).'result'.$result;
        return parent::afterAction($action, $result);
    }
}